﻿using System;
using System.Collections.Generic;
using System.Text;
using FreeSql.DataAnnotations;

namespace Model
{
    public class ProductInfo
    {
        [Column(IsIdentity = false, IsPrimary = true)]
        public string Pid { get; set; }
        public string Pname { get; set; }
        public string Pintro { get; set; }
        public DateTime Pdate { get; set; }
        public int Pnum { get; set; }
        public double Psale { get; set; }
        public double Pprice { get; set; }
        public string Ptag { get; set; }
        public bool rcmd { get; set; }
        //默认构造函数
        public ProductInfo() { }
        //所有参数(几乎用不到，但是还是写一个)
        public ProductInfo(string Pid, string Pname, string Pintro, DateTime Pdate, int Pnum, double Psale, double Pprice, string Ptag, bool rcmd)
        {
            this.Pid = Pid;
            this.Pname = Pname;
            this.Pintro = Pintro;
            this.Pdate = Pdate;
            this.Pnum = Pnum;
            this.Psale = Psale;
            this.Pprice = Pprice;
            this.Ptag = Ptag;
            this.rcmd = rcmd;
        }
        //管理员界面
        public ProductInfo(string Pid, string Pname, DateTime Pdate)
        {
            this.Pid = Pid;
            this.Pname = Pname;
            this.Pdate = Pdate;
        }
        //商品信息
        public ProductInfo(string Pid, string Pname, string Pintro, DateTime Pdate, int Pnum, double Psale, double Pprice, string Ptag)
        {
            this.Pid = Pid;
            this.Pname = Pname;
            this.Pintro = Pintro;
            this.Pdate = Pdate;
            this.Pnum = Pnum;
            this.Psale = Psale;
            this.Pprice = Pprice;
            this.Ptag = Ptag;
        }
        //商品信息、促销价、价格
        public ProductInfo(string Pid, string Pname, double Pprice, double Psale)
        {
            this.Pid = Pid;
            this.Pname = Pname;
            this.Pprice = Pprice;
            this.Psale = Psale;
        }
    }
}
